const {ccclass, property} = cc._decorator;

@ccclass
export default class SceneA extends cc.Component {
    onBtnBack() {
        cc.director.loadScene("helloworld", (err, scene) => {
            cc.director.runScene(scene);
        });
    }

    onBtnSetting() {
        let A = cc.assetManager.getBundle('A');
        A.load('prefab/setting/setting', cc.Prefab, function(err, prefab) {
            if (err)
                return console.log(err);
            
            let node = cc.instantiate(prefab);
            this.node.addChild(node);
        }.bind(this));
    }

    onBtnMail() {
        let A = cc.assetManager.getBundle('A');
        A.load('prefab/mail/mail', cc.Prefab,  function(err, prefab) {
            if (err)
                return console.log(err);

            let node = cc.instantiate(prefab);
            this.node.addChild(node);
        }.bind(this));
    }
}
